﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_Wumpers
{
	class Wumpus
	{
		private int location = 10;
		private int roomCounter = 0;
		private WumpusState wumpusState;

		public Wumpus(int location)
		{
			this.location = location;
		}
		public enum WumpusState {Awake,Asleep};
		public int Location { get; set; }
		public int RoomCounter { get; set; }

		public WumpusState EnumProperty
		{
			get
			{
				return wumpusState;
			}

			set
			{
				wumpusState = value;
			}
		}

		public int Move(Room[] rooms)
		{
            Console.Write("Start Location: " + this.location);
			Random rnd = new Random();
			int indexNum = rnd.Next(0,6);
            if (indexNum == 0 && rooms[this.location].NorthWestOpen == true) { int temp = this.location; this.location = rooms[this.location].northWest; return rooms[temp].northWest; }
            if (indexNum == 1 && rooms[this.location].NorthOpen == true)     { int temp = this.location; this.location = rooms[this.location].north;     return rooms[temp].north; }
            if (indexNum == 2 && rooms[this.location].NorthEastOpen == true) { int temp = this.location; this.location = rooms[this.location].northEast; return rooms[temp].northEast; }
            if (indexNum == 3 && rooms[this.location].SouthWestOpen == true) { int temp = this.location; this.location = rooms[this.location].SouthWest; return rooms[temp].SouthWest; }
            if (indexNum == 4 && rooms[this.location].SouthOpen == true)     { int temp = this.location; this.location = rooms[this.location].South;     return rooms[temp].South; }
            if (indexNum == 5 && rooms[this.location].SouthEastOpen == true) { int temp = this.location; this.location = rooms[this.location].SouthEast; return rooms[temp].SouthEast; }
            else return this.location;
			
		}
	}
}
